void npc(Player @player, NPC @npc) {
   int state = npc.getState();
   int type = npc.getSelected();
   npc.setVariable("type", type);
   if(state == 0){
      if(player.getItemAmount(4001020) == 0){
         npc.addText("There's a rock that will enable you to teleport to #bSecond Eos Rock or Fourth Eos Rock#k, but it cannot be activated without the scroll.");
         npc.sendOK();
         npc.end();
      }
      else{
         npc.addText("You can use #bEos Rock Scroll#k to activate #bThird Eos Rock#k. Which of these rocks would you like to teleport to? #b\r\n#L0#Second Eos Rock(71st floor)#l\r\n#L1#Fourth Eos Rock(1st floor)#l#k");
         npc.sendSimple();
      }
   }
   if(state == 1){
      if(type == 0){
         npc.addText("You can use #bEos Rock Scroll#k to activate #bThird Eos Rock#k. Will you teleport to #bSecond Eos Rock#k at the 71st floor?");
         npc.sendYesNo();
      }
      else if(type == 1){
         npc.addText("You can use #bEos Rock Scroll#k to activate #bThird Eos Rock#k. Will you teleport to #bFourth Eos Rock#k at the 1st floor?");
         npc.setState(npc.getState()+1);
         npc.sendYesNo();
      }
   }
   if(state == 2){
      if(npc.getSelected() == YES){
         player.giveItem(4001020, -1);
         player.changeMap(221022900);
      }
      npc.end();
   }
   if(state == 3){
      if(npc.getSelected() == YES){
         player.giveItem(4001020, -1);
         player.changeMap(221020000);
      }
      npc.end();
    }
}